'''
movie.txt中保存若干行记录。
comment.txt中保存有若干行记录。

请编写一个程序将两个文件的内容逐行合并，
然后将其保存到result.txt中。程序须保存test.py中

'''
f = open('movie.txt','r',encoding='utf')
g = open('comment.txt','r',encoding='utf')
h = open('result.txt','w',encoding='utf')
fi = f.readlines()
gi = g.readlines()
if len(fi) >= len(gi):
    for i in range(len(gi)):
        h.write(fi[i])
        h.write(gi[i])
    for i in range(len(gi),len(fi)):
        h.write(fi[i])
else:
    for i in range(len(fi)):
        h.write(fi[i])
        h.write(gi[i])
    for i in range(len(fi),len(gi)):
        h.write(gi[i])    
h.close()
        
        
        
